-- BP 7.1.6 content: ModelClass syschar: 3 persistence-version: 7.1.6

INSERT INTO O_OBJ
	VALUES ("8d429a5e-1677-40ae-9443-2ea3522bb9ed",
	'Intersecting',
	1004,
	'INP',
	'An intersecting partitioning represents the partitioning formed by the 
intersection of two or more objects. If more than two objects are involved, all 
the objects must overlap at the same subset.',
	"00000000-0000-0000-0000-000000000000");
INSERT INTO O_TFR
	VALUES ("a349086e-5de4-4eb2-824e-c7ce2723bc41",
	"8d429a5e-1677-40ae-9443-2ea3522bb9ed",
	'intersecting_init',
	'An example of object intersection is object A as supertype with subtype objects 
C and D and object B as supertype with subtype objects D and E. Subtype D is 
subset formed by the intersection of A and B.





Diagram:

+----------+ +---------+ +----------+
|    C     | |    D    | |    E     |
|          | |         | |          |
+----------+ +---------+ +----------+
     |         |    |         |
     +---------+    +---------+ 
          |              |
     +---------+    +---------+
     |    A    |    |    B    |
     |         |    |         |
     +---------+    +---------+
',
	"ba5eda7a-def5-0000-0000-000000000000",
	1,
	'// Object A
create object instance domain of DOM;
create object instance modeled_domain of MDOM;
relate domain to modeled_domain across R1;
create object instance objA of OBJ;
relate objA to modeled_domain across R105;
create object instance subA of SUB;
relate subA to objA across R107;
// Subset C
create object instance subC of SUB;
create object instance psubC of PRP;
relate subC to psubC across R107;
create object instance non_psubC of NSB;
relate psubC to non_psubC across R108;
// Supertype A
create object instance superA of SUP;
create object instance chdA of CHD;
relate superA to objA across R134 using chdA;
relate non_psubC to superA across R136;
create object instance subtypeC of SBT;
relate superA to psubC across R122 using subtypeC;
create object instance obsA of OBS;
relate subtypeC to obsA across R126;
create object instance sbsC of SBS;
relate sbsC to obsA across R125;
// Object B
create object instance objB of OBJ;
relate objB to modeled_domain across R105;
create object instance subB of SUB;
relate subB to objB across R107;
// Subset E
create object instance subE of SUB;
create object instance psubE of PRP;
relate subE to psubE across R107;
create object instance non_psubE of NSB;
relate psubE to non_psubE across R108;
// Supertype B
create object instance superB of SUP;
create object instance chdB of CHD;
relate superB to objB across R134 using chdB;
relate non_psubE to superB across R136;
create object instance subtypeE of SBT;
relate superA to psubE across R122 using subtypeE;
create object instance obsB of OBS;
relate subtypeE to obsB across R126;
create object instance sbsE of SBS;
relate sbsE to obsB across R125;
// Intersecting subset D
create object instance subD of SUB;
create object instance psubD of PRP;
relate subD to psubD across R107;
create object instance isb_psubD of ISB;
relate psubD to isb_psubD across R108;
create object instance intA of ITS;
relate isb_psubD to objA across R135 using intA;
create object instance intB of ITS;
relate isb_psubD to objB across R135 using intB;
// Supertype relationships for intersecting subtypes
create object instance subtypeD of SBT;
relate psubD to superA across R122 using subtypeD;
relate psubD to superB across R122 using subtypeD;
relate obsA to subtypeD across R126;
relate intA to obsA across R125;
relate obsB to subtypeD across R126;
relate intB to obsB across R125;
// Attributes
// Make the first one an identifier, as you can''t create instances without an 
// identifier.
// NOTE: In intersections, an identifier must be common to all intersecting 
//       sets.
// TODO: Create a check for this
// TODO: Handle this for cases with multiple intersections.
//       * Supers A, B, and C intersect at sub D.
//       * Super A intersects super B at sub D and super A intersects super F 
//         at sub C. (common identifier for A, B, and F)
create object instance attribute1 of ATR;
create object instance nonref1 of NRA;
relate attribute1 to nonref1 across R103;
create object instance objectAttribute1 of OA;
relate objectAttribute1 to attribute1 across R124;
relate objectAttribute1 to objA across R129;
create object instance identifier1 of ID;
create object instance participation1 of IDP;
relate identifier1 to attribute1 across R102 using participation1;
// Make an numeric attribute as a specializer for subtype C.
create object instance attribute2 of ATR;
create object instance nonref2 of NRA;
relate attribute2 to nonref2 across R103;
create object instance attribution2 of SPA;
relate attribution2 to attribute2 across R124;
relate attribution2 to psubC across R130;
create object instance objectSpecialization2 of OBS;
relate objectSpecialization2 to attribution2 across R125;
relate objectSpecialization2 to subtypeC across R126;
// Make an attribute as a specializer for subtype E.
create object instance attribute4 of ATR;
create object instance nonref4 of NRA;
relate attribute4 to nonref4 across R103;
create object instance attribution4 of SPA;
relate attribution4 to attribute4 across R124;
relate attribution4 to psubE across R130;
create object instance objectSpecialization4 of OBS;
relate attribution4 to objectSpecialization4 across R125;
relate objectSpecialization4 to subtypeE across R126;
// Make an attribute as a specializer for subtype D.
create object instance attribute5 of ATR;
create object instance nonref5 of NRA;
relate attribute5 to nonref5 across R103;
create object instance attribution5 of SPA;
relate attribution5 to attribute5 across R124;
relate attribution5 to psubD across R130;
create object instance objectSpecialization5 of OBS;
relate attribution5 to objectSpecialization5 across R125;
relate objectSpecialization5 to subtypeD across R126;
// Create instances
// NOTE: Creation of A or B should be illegal.
// Create an instance of subtype C
create object instance instance1 of INS;
relate instance1 to subC across R112;
create object instance instantiation1 of ITN;
relate instance1 to identifier1 across R101 using instantiation1;
// Create an instance of subtype D
create object instance instance3 of INS;
relate instance3 to subD across R112;
create object instance instantiation3 of ITN;
relate instance3 to identifier1 across R101 using instantiation3;
// Create an instance of subtype E
create object instance instance2 of INS;
relate instance2 to subD across R112;
create object instance instantiation2 of ITN;
relate instance2 to identifier1 across R101 using instantiation2;',
	1,
	'',
	"00000000-0000-0000-0000-000000000000",
	0);
INSERT INTO O_ID
	VALUES (0,
	"8d429a5e-1677-40ae-9443-2ea3522bb9ed");
INSERT INTO O_ID
	VALUES (1,
	"8d429a5e-1677-40ae-9443-2ea3522bb9ed");
INSERT INTO O_ID
	VALUES (2,
	"8d429a5e-1677-40ae-9443-2ea3522bb9ed");
INSERT INTO PE_PE
	VALUES ("8d429a5e-1677-40ae-9443-2ea3522bb9ed",
	1,
	"6e3add14-c14c-40a1-95a3-bbc196442c2d",
	"00000000-0000-0000-0000-000000000000",
	4);
INSERT INTO EP_PKG_PROXY
	VALUES ("6e3add14-c14c-40a1-95a3-bbc196442c2d",
	"00000000-0000-0000-0000-000000000000",
	"c8b88000-dddc-4206-8410-2f69b8f86b67",
	'Object Subsystem Tests',
	'This package can be used to check various instantiation scenarios for the 
object subsystem.
Current usage: Create an unspecialized object, and create each of the types of 
specialized objects.',
	1000,
	'../Object Subsystem Tests.xtuml');
